-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Add test of Arrow roundtrip of boolean values, raise exception on GDAL <3.8.3 for bool values via Arrow API #335
Conversation
GDAL 3.8.3 fixes this and has just been released... |
Because misreading boolean values is a bad error, this adds an exception to I used an |
Good idea!
I'm not sure if the xfail is that interesting as the test testing for the exception for GDAL < 3.8 will fail anyway. It feels like it's a pity that it is not possible to specify a
Or am I missing something? |
No, you're right: I didn't have my logic correct for the xfail because we also specifically check the GDAL version in the implementation and always raise an exception. I don't want to make that more granular by preemptively adding GDAL versions that don't yet exist to try and catch this, e.g., in
Instead, we probably just have to watch the changelog for GDAL and update the implementation if the fix gets backported (it may not; I recall that some of the other Arrow fixes were not going to be backported from the 3.8.x lineage). Will remove the xfail cases... |
According to the GDAL PR fixing this, this only affects reading GPKG/FlatGeoBuf files. Would we have a way to check for that? (we don't know the driver because that gets inferred while reading, except if we explicitly get that info ( |
Indeed; I had assumed it applied to all the bool drivers because it was in It looks like boolean values roundtripped properly for SQLite / GeoJSON / GML (not able to easily test postgres) - so our exception would be raised when the functionality is just fine. Will add a fix for this. |
Maybe it is because that utility function is only used by drivers that have a custom implementation of GetArrowStream that sidesteps the internal GDAL data model (which are only GPKG and FlatGeoBuf, AFAIK, apart from Parquet/Arrow, but those already are already in arrow format after reading, of course). Other drivers fall back to a default implementation based on the standard APIs to read data (like we also use) |
Test to reproduce #334 incorrect handling of boolean values using Arrow I/O (mostly to see if this also fails on GDAL >= 3.8.1).
As the root cause has been solved and released in GDAL, this PR now resolves #334